<!DOCTYPE html>
<html>
	<head> 
		<meta charset="utf-8">
		<link rel="icon" href="../imges/logo1.png" type="img/x-ico" />
		<title>用户Login</title>
		<link href="../css/bootstrap.min.css" rel="stylesheet" />
		<link href="../css/bootstrap.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="../logincss/login.css"/>
		<script src="../js/jquery-3.4.1.js"></script>
		<script type="application/javascript">
			$(function(){
				$("#submitUser").click(function(){
					//获取文本输入的值
					var UserName=$("#UN").val();
					var PassWord=$("#PSD").val();
					//读取json
					$.getJSON("../json/login.json",function(data){
						//判断登入
						console.log(data);
						if(UserName==data.name && PassWord==data.psw){
							//登录成功
							location.href="mainframe.html";
						}else{
							alert("您的账号密码错误");
							//清空
							$("#UN").val("");
							$("#PSD").val("");
						};
					});
				});
			});
		</script>
	</head>
	<body>
		<!-- login界面头部 -->
		<div class="header" style="width: 100%;height: 13%;text-align: center;">
			<!-- login界面标题 -->
			<h1><img src="../imges/logo.png" class="logo">电厂信息业务支撑平台</h1>
			<h3 style="font-weight: 50;font-size: 20px;"> 
				Power Plant Information Business Support Platform
			</h3>
		</div>
		<center>
			<!-- login登录 -->
			<form method="get">
				<div  class="container" style="text-align: center; width: 32%;height: 300px;border: 2px solid #99fcda;border-radius: 8px;box-shadow: 0px 0px 10px rgba(217,254,214,1);margin-top: 2%;">
					<h4 align="left" style="font-weight: 100;">
						<span style="font-size: 20px;">用户登录</span>User Login
					</h4>
					<!-- 用户名 -->
					<span class="glyphicon glyphicon-user" style="color: #99fcda;"></span>&nbsp;
					<input type="text" name="UserName" id="UN" placeholder="请输入用户名" class="txt" maxlength="20"/><br />
					<!-- 密码 -->
					<span class="glyphicon glyphicon-lock" style="color: #99fcda;"></span>&nbsp;
					<input type="password" name="PassWorld" id="PSD" placeholder="请输入密码" class="txt" maxlength="20"/>
					<br />
					<!-- 提交方式 -->
					<button id="submitUser" type="button" class="bn">登录</button>
					<button id="resetUser" type="reset" class="bn">重置</button>
				</div>
			</form>
		</center>
		
	</body>
</html>
